// pages/next/next.js
Page({
  data: {
    lose: '',
    succeed: '',
    diwusucceed:'',
    loses:'',
    succese:'',
    numtc:0
  },
  // 返回上一个页面
  back1: function () {
    if(this.data.lose == 1){
      tt.redirectTo({
        url: "/pages/index1/index1",
      });
    }
    if(this.data.lose == 2){
      tt.redirectTo({
        url: "/pages/index2/index2",
      });
    }
    if(this.data.lose == 3){
      tt.redirectTo({
        url: "/pages/index3/index3",
      });
    }
    if(this.data.lose == 4){
      tt.redirectTo({
        url: "/pages/index4/index4",
      });
    }
    if(this.data.lose == 5){
      tt.redirectTo({
        url: "/pages/index5/index5",
      });
    }
  },
  next: function () {
    if(this.data.succeed == 1){
      tt.redirectTo({
        url: "/pages/index2/index2",
      });
    }
    if(this.data.succeed == 2){
      tt.redirectTo({
        url: "/pages/index3/index3",
      });
    }
    if(this.data.succeed == 3){
      tt.redirectTo({
        url: "/pages/index4/index4",
      });
    }
    if(this.data.succeed == 4){
      tt.redirectTo({
        url: "/pages/index5/index5",
      });
    }
  },
  lastnext: function () {
    console.log('adsa')
    tt.redirectTo({
      url: "/pages/index6/index6",
    });
  },
  anewagain: function () {
    tt.redirectTo({
      url: "/pages/index1/index1",
    });
  },
  onLoad: function (options) {
    if(options.lose){
      var lose = options.lose
      this.setData({
        lose: lose,
        numtc: 1,
      })
    }
    if(options.succeed){
      var succeed = options.succeed
      this.setData({
        succeed: succeed,
        numtc: 2,
      })
    }
    if(options.diwusucceed){
      var diwusucceed = options.diwusucceed
      this.setData({
        diwusucceed: diwusucceed,
        numtc: 3,
      })
    }
    if(options.loses){
      var loses = options.loses
      this.setData({
        loses: loses,
        numtc: 4,
      })
    }
    if(options.succese){
      var succese = options.succese
      this.setData({
        succese: succese,
        numtc: 5,
      })
    }
  }
})